import operate from '@dfeidao/atom-nodejs/db/operate';


interface Message {
	id: string;
	productid: string;
}

export default async function atom(msg: Message, action_id: string, session_id: string, spaceid: string) {
	const systemid = '12';
	// const date = await sys_date(action_id, session_id);
	const { exec, del } = operate(action_id, session_id, systemid);
	// const user = await whoami(action_id, session_id, msg.productid);
	del('pub_user_connect', { _id: msg.id, productid: msg.productid });


	const ret = await exec();
	if (ret.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}
}
